package main.java.ERMDE.controllers;

import java.awt.Point;

import javax.xml.parsers.ParserConfigurationException;

import main.java.ERMDE.controllers.listeners.IDiagramEventListener;
import main.java.ERMDE.controllers.listeners.IEntityEventListener;
import main.java.ERMDE.controllers.listeners.IHierarchyEventListener;
import main.java.ERMDE.controllers.listeners.IRelationshipEventListener;
import main.java.ERMDE.models.Diagram;
import main.java.ERMDE.models.Entity;
import main.java.ERMDE.models.Hierarchy;
import main.java.ERMDE.models.Relationship;
import main.java.ERMDE.views.IDiagramView;


import com.mxgraph.model.mxCell;
import com.mxgraph.view.mxGraph;

public interface IDiagramController extends IEntityEventListener,
		IRelationshipEventListener, IHierarchyEventListener {
	void createSubDiagram(String diagramName);

	void addListener(IDiagramEventListener iDiagramEventListener);

	mxGraph getGraph();

	Diagram getDiagram();

	void createEntity();

	void createRelationship();

	void createHierarchy();

	void addEntity(double x, double y) throws Exception;

	mxCell getEntityCell(String id);

	mxCell getAttributeCell(String id);

	mxCell getAttributeConnectorCell(String id);

	mxCell getIdGroupConnectorCell(String string);

	mxCell getWeakEntityConnectorCell(String id);

	boolean hasPendingEntity();

	void save() throws ParserConfigurationException;

	IDiagramView getView();

	void handleDrop(Point end);

	void handleDragStart(Point start);

	void load(Diagram diagram);

	void updateEntity(Entity entity);

	void updateRelationship(Relationship relationship);

	void updateHierarchy(Hierarchy hierarchy);

	void deleteEntityPeripherals(Entity entity);

	Iterable<Entity> getAvailableEntities();

	boolean deleteEntity(Entity entity);

	boolean deleteRelationship(Relationship relationship);

	boolean deleteHierarchy(Hierarchy hierarchy);

	void validate();

	void removeListener();
}
